@(title: String)(content: Html)
@import controllers.user.UserController
@import models.Category
<!DOCTYPE html>

<html>
    <head>
        <title>@title</title>
				<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/bootstrap.min.css")">
				<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/bootstrap.css")">
				<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/styles.css")" />

        <link rel="shortcut icon" type="image/png" href="@routes.Assets.at("images/favicon.png")">
        <script src="@routes.Assets.at("javascripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
    </head>
    
    <body>
    <!--head-------------------------------->

<form action="/advertisement/search" method="get" align="right" style="position: absolute;right: 70px;top: 12px;display: inline-block;">
	<input type="text" name="query" value="" placeholder="Search is Ads..." >
</form>

    <div id='cssmenu'>
<ul>	
   <li><a href='/'><span>Webshop</span></a></li>
   <li class='has-sub'><a href'#'><span>Ads</span></a>
      <ul>
				@for(rootCat <- Category.rootCategories()){
         <li class='has-sub'><a href='/advertisement/list/@rootCat.getId()'>
						<span>
							<p class="badge pull-right">@rootCat.getNumOfAds(rootCat.getId())</p>
							@rootCat.getName()
						</span></a>
            @if(rootCat.hasChildren()){ <ul> }
							 @for(childCat <- rootCat.getChildren()){
               <li><a href='/advertisement/list/@childCat.getId()'>
									<span>
										<p class="badge pull-right">@childCat.getNumOfAds(childCat.getId())</p>
									@childCat.getName()</span></a></li>
               }
            @if(rootCat.hasChildren()){ </ul> }
				 </li>
				 }
      </ul>
   </li> <!--end of Products-->
   <!--<li><a href='/advertisement'><span>Advertisements</span></a></li>-->
   <li class='has-sub'><a href='#'><span>User</span></a>
      <ul>
 			 @if(session.get("currentUserEmail") == null){
    		<li class='last'><a href='/users/logIn'><span>LogIn</span></a></li>
    		<li class='last'><a href='/users/signUp'><span>SingUp</span></a></li>
  		 }else{
  		  <li             ><a href='/advertisement/add'><span>addAdvertisement</span></a></li>
  		  <li             ><a href='/users/myAds'><span>myAdvertisements</span></a></li>
  		 	<li             ><a href='/users/chgPsw'><span>Change Password</span></a></li>
    		<li class='last'><a href='/users/logOut'><span>LogOut</span></a></li>
    		}
      </ul>
   </li> <!--end of Users-->
	 <!--@if(session.get("currentUserEmail") != null && UserController.getCurrentUser().getPriv("worker")){
	 		@if(UserController.getCurrentUser().getRole().getName().equals("admin")){
	   		<li class='has-sub'><a href='#'><span>Admin</span></a>
				<ul>	
					<li><a href='/users'><span>deleteUser</span></a></li>
			}else{
				<li class='has-sub'><a href='#'><span>Employee</span></a>
				<ul>
			}
					<li><a href='/product/newProduct'><span>addProduct</span></a></li>
					<li><a href='/categories'><span>addCategory</span></a></li>
					<li><a href='#'><span>Rf</span></a></li>
				</ul>
	 			</li>
   }-->
</ul>
</div>

<div align="right" style= margin-right:10px>
	<a>
	<img id="shoppingCart" src="@routes.Assets.at("images/cart.png")" height="30" width="30">
	</a>
</div>   

    <!--content-------------------------------->
    <div id="content">
        @content
    </div>
    
    <!--foot-------------------------------->
    <div id="footer">
            Rf 2013 (c) <a href='/'><font color="white">play</a> @session.get("currentUserEmail")</font><br />
    </div>
    
    </body>
</html>
